home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-05-01 | 1.5 KB | 56 lines | [TEXT/????] |
- % ---------------------------------------------------------------------------
- % Class MACEvent
- %
- % Part of the interface to Macintosh Toolbox
- % MACEvent is part of the programming interface. Events are used to communicate
- % events to and from the program.
- % Se Inside Macintosh for a description of wah the attributes means.
- %
- % 890329/Boris Magnusson
- %
- % ---------------------------------------------------------------------------
- external class macPoint="::Sinterfaces:MacPoint";
- class MACEvent;
- begin
- short integer modifiers;
- short integer point_h;
- short integer point_v;
- integer e_when;
- integer message;
- short integer what;
-
- procedure CopyPoint(p);
- ref(macpoint) p;
- begin
- p.v:=point_v;
- p.h:=point_h;
- end;
- procedure copyEvent(e);
- ref(macEvent) e;
- begin
- e.modifiers:=modifiers;
- e.point_h:=point_h;
- e.point_v:=point_v;
- e.e_when:=e_when;
- e.message:=message;
- e.what:=What;
- end;
- Boolean procedure OptionKey;
- OptionKey:=mod(modifiers,2**12)//2**11<>0;
- Boolean procedure CapsLock;
- CapsLock:=mod(modifiers,2**11)//2**10<>0;
- Boolean procedure ShiftKey;
- ShiftKey:=mod(modifiers,2**10)//2**9<>0;
- Boolean procedure commandKey;
- CommandKey:=mod(modifiers,2**9)//2**8<>0;
- Boolean procedure mouseButtonUp;
- mouseButtonUp:=mod(modifiers,2**8)//2**7<>0;
- Boolean procedure activated;
- activated:=mod(modifiers,2**1)<>0;
- character procedure keyPressed;
- keyPressed:=char( mod(Message,2**8) );
- integer procedure keyCode;
- keyCode:= mod(Message,2**16)//2**8;
-
- end;
-